package ooday03;

public class Test {
    public static void main(String[] args) {
        Dog dog = new Dog("小黑",3,"黑");
        System.out.println(dog.name);

        Dog[] dogs = new Dog[3];
        dogs[0] = new Dog("小白",2,"白");
        dogs[1] = new Dog("小黑",3,"黑");
        dogs[2] = new Dog("小黄",3,"黄");
        System.out.println(dogs[0].name);
        dogs[1].age = 1;
        dogs[2].swim();
        for (int i=0;i<dogs.length;i++){
            System.out.println(dogs[i].name);
            dogs[i].eat();
        }

        Chick[] chicks = new Chick[2];
        chicks[0] = new Chick("兰兰",1,"灰");
        chicks[1] = new Chick("菜菜",2,"黑");
        System.out.println(chicks[0].name);
        for (int i=0;i<chicks.length;i++){
            System.out.println(chicks[i].name);
            chicks[i].layEggs();
        }

        Fish[] fish = new Fish[5];
        fish[0] = new Fish("金金",6,"金");
        fish[1] = new Fish("甜甜",9,"蓝");
        fish[2] = new Fish("桃桃",12,"白");
        fish[3] = new Fish("瑶瑶",18,"粉红");
        fish[4] = new Fish("涵涵",3,"淡蓝");
        for (int i=0;i<fish.length;i++){
            System.out.println(fish[i].name);
            fish[i].swim();
        }
    }
}





































        /*
        Dog td = new Dog("泰迪",3,"白");
        td.drink();
        td.lookHome();
        td.eat();

        Chick hh = new Chick("花花",1,"粉红");
        hh.drink();
        hh.layEggs();
        hh.eat();

        Fish ll = new Fish("兰兰",1,"金");
        ll.drink();
        ll.eat();
    }

         */

